load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "errwrap",
    srcs = [
        "errwrap.go",
        "functions.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/errwrap",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/testutils/lint/passes/passesutil",
        "@org_golang_x_tools//go/analysis",
        "@org_golang_x_tools//go/analysis/passes/inspect",
        "@org_golang_x_tools//go/ast/inspector",
    ],
)

go_test(
    name = "errwrap_test",
    srcs = ["errwrap_test.go"],
    data = glob(["testdata/**"]) + [
        "@go_sdk//:files",
    ],
    deps = [
        ":errwrap",
        "//pkg/build/bazel",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/skip",
        "@org_golang_x_tools//go/analysis/analysistest",
    ],
)
